#import "AppVersion.h"
#import "AppDelegate.h"
#import <Cordova/CDV.h>

@implementation AppVersion

- (void)version:(CDVInvokedUrlCommand *)command {
    // app版本
    NSString *app_Version = [NSString stringWithFormat:@"v%@", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]];
    CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:app_Version];
    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

@end
